#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        // 操作对象
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery;

        form.on('submit(sub)', function (data) {

            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)/app/country/postAdd',
                data: $('#addForm').serialize(),
                loadFlag: true,
                success: function (data) {
                    pop_close();
                }
            });

            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>
#end

#define content()
<div class="x-body">
    <form id="addForm" class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>名称</label>
            <div class="layui-input-block">
                <input type="text" name="model.name" placeholder="名称" class="layui-input" value="" required
                       lay-verify="required" STYLE="width: 280PX" autocomplete="off"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>排序</label>
            <div class="layui-input-block">
                <input id="sort" type="text" name="model.sort" placeholder="排序" class="layui-input" value="1" required
                       lay-verify="required" STYLE="width: 280PX" autocomplete="off"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input id="remark" type="text" name="model.remark" placeholder="备注" class="layui-input" value=""
                       STYLE="width: 280PX" autocomplete="off"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button class="layui-btn" lay-filter="sub" lay-submit>
                保存
            </button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </form>
</div>
#end